package com.eastmelon.tcp;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;

public class UploadClient1 {
	public static void main(String[] args) throws Exception {
		Socket s=new Socket("127.0.0.1",10004);
		BufferedReader bufr=new BufferedReader(new FileReader("D:\\1.txt"));
		PrintWriter out=new PrintWriter(s.getOutputStream());
		String line=null;
		while((line=bufr.readLine())!=null){
			out.println(line);
		}
		s.shutdownOutput();//关闭客户端输入流
		BufferedReader bufIn=new BufferedReader(new InputStreamReader(s.getInputStream()));
		String str=bufIn.readLine();
		System.out.println(str);
		bufr.close();
		s.close();
	}

}
